import './index.scss';
import { PureComponent } from 'react';
import T from 'utils/T';
import { Map } from 'react-amap';


export default class AMap extends PureComponent{
    render(){
        return (<div className={'amapAppBox'}>
            <Map
                amapkey={window.ENV.map.amapkey}
                // version={VERSION}
            >
                <ToolBox>

                </ToolBox>
            </Map>
        </div>)
    }
}

class ToolBox extends PureComponent{

    constructor(props){
        super(props);
        this.AMap = props.__map__;
        this.state = {

        }
    }
    render() {
        const zoomIn = () => this.AMap.zoomIn();
        const zoomOut = () => this.AMap.zoomOut();

        return (
            <div className={'toolBox'}>
                <ul className={'leftToolBox'}>
                    <li><button onClick={zoomIn}>zoom in</button></li>
                    <li><button onClick={zoomOut}>zoom out</button></li>
                </ul>
            </div>
        );
    }
}
